/*
 * @Author: silence
 * @Date: 2023-12-27 12:09:32
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2024-02-19 14:10:08
 * @Description: 公共方法
 */
import '../entity/TranslateEntity.dart';

///英语翻译成指定语言的地址
String getUrl(String targetCode, String text) {
  // Google翻译
  String url =
      "https://translate.google.com/?hl=zh&sl=zh-CN&tl=${targetCode}&text=${text}&op=translate";

  // Deeple 翻译，这个翻译不太行
  // Deeple 翻译有问题，需要将需要翻译的文字中的换行符去掉
  // String url = "https://www.deepl.com/translator#zh/$targetCode/$text";

  return url;
}

List<TranslateEntity> entitys = [
  // TranslateEntity(code: "zh-Hans", title: "简体", urlCode: "zh-CN"),
  TranslateEntity(code: "en", title: "英语", urlCode: "en"),
  TranslateEntity(code: "zh-Hant", title: "繁体", urlCode: "zh-TW"),
  TranslateEntity(code: "de", title: "德语", urlCode: "de"),
  TranslateEntity(code: "et", title: "爱沙尼亚语", urlCode: "et"),
  TranslateEntity(code: "ru", title: "俄语", urlCode: "ru"),
  TranslateEntity(code: "hu", title: "匈牙利语", urlCode: "hu"),
  TranslateEntity(code: "cs", title: "捷克语", urlCode: "cs"),
  TranslateEntity(code: "ro", title: "罗马尼亚", urlCode: "ro"),

  // TranslateEntity(code: "es", title: "西班牙", urlCode: "es"),
  // TranslateEntity(code: "fr", title: "法语", urlCode: "fr"),
  // TranslateEntity(code: "hi", title: "印地语", urlCode: "hi"),
  // TranslateEntity(code: "id", title: "印尼", urlCode: "id"),
  // TranslateEntity(code: "it", title: "意大利", urlCode: "it"),
  // TranslateEntity(code: "ja", title: "日语", urlCode: "ja"),
  // TranslateEntity(code: "kk", title: "哈萨克", urlCode: "kk"),
  // TranslateEntity(code: "ko", title: "韩语", urlCode: "ko"),
  // TranslateEntity(code: "pl", title: "波兰", urlCode: "pl"),
  // TranslateEntity(code: "pt", title: "葡萄牙", urlCode: "pt"),
  // TranslateEntity(code: "th", title: "泰语", urlCode: "th"),
  // TranslateEntity(code: "tr", title: "土耳其", urlCode: "tr"),
  // TranslateEntity(code: "uk", title: "乌克兰", urlCode: "uk"),
  // TranslateEntity(code: "vi", title: "越南", urlCode: "vi"),
];
